#include <iostream>
using namespace std;
#pragma once



template <typename T> 
class BinaryTreeNode
{
public:
	T m_data;
	BinaryTreeNode<T>* pLNode;
	BinaryTreeNode<T>* pRNode;
public:
	BinaryTreeNode<T>(void):m_data(NULL),pLNode(NULL),pRNode(NULL){};
	BinaryTreeNode<T>(T data):m_data(data),pLNode(NULL),pRNode(NULL){};
	~BinaryTreeNode<T>(void);
	void display();
};

template <typename T>
void BinaryTreeNode<T>::display()
{
	cout<<"node: "<<m_data;
	if (pLNode)
	{
		cout<<" LeftNode: "<<pLNode->m_data;
	}
	if (pRNode)
	{
		cout<<" RightNode: "<<pRNode->m_data;
	}
	cout<<endl;
}


template <typename T>
class BinaryTree
{
	//typedef void pfun(BinaryTreeNode<T>*);
public:
	BinaryTreeNode<T>* pHeadNode;
public:
	BinaryTree<T>(void):pHeadNode(NULL){};
	BinaryTree<T>(T data){pHeadNode=new BinaryTreeNode<T>(data);};
	BinaryTree<T>(BinaryTreeNode<T>* pNewNode){pHeadNode=pNewNode;};
	void Output();
	static void PreOrderTraverse(BinaryTreeNode<T>* pRootNode);
	void BreadthFirstTraverse();
	~BinaryTree<T>(void){};
};

template <typename T>
void BinaryTree<T>::BreadthFirstTraverse()
{
	

}
template <typename T>
void BinaryTree<T>::PreOrderTraverse( BinaryTreeNode<T>* pRootNode)
{

	if (pRootNode)
	{
		pRootNode->display();
		PreOrderTraverse(pRootNode->pLNode);
		PreOrderTraverse(pRootNode->pRNode);
	}
}


template <typename T>
void BinaryTree<T>::Output()
{


}